﻿using MediatR;
using W.Purchase.Domain;
using W.Purchase.Read.API.AppLication.Command.Command;
using W.Purchase.Repository.Interface;

namespace W.Purchase.Read.API.AppLication.Command.CommandHandler
{
    public class ContactShowCommandHandler : IRequestHandler<ContactShowCommand, List<Contact>>
    {
        private readonly IContactRepository contact;
        public ContactShowCommandHandler(IContactRepository contact)
        {
            this.contact = contact;
        }
        public async Task<List<Contact>> Handle(ContactShowCommand request, CancellationToken cancellationToken)
        {
            var list = await contact.GetAsync(x => x.IsDelete == false);
            return list;
        }
    }
}
